<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
        function ajax_submit(username) {
            var oldPassword = $("#oldPassword").val();//获取表单的输入值;
            var newPassword = $("#newPassword").val();//获取表单的输入值;
            $.ajax({
                type: "post",  //数据提交方式（post/get）
                url: "/sichuan_war_exploded/editPassword",  //提交到的url
                data: {"username":username,"oldPassword":oldPassword,"newPassword":newPassword},//提交的数据
                dataType: "json",//返回的数据类型格式
                success: function(msg){
                    console.log(msg)
                    if (msg.state){  //修改成功
                        //修改成功处理代码...
                        console.log("good")
                    }else {  //修改失败
                        //修改失败处理代码...
                        console.log("bad")

                    }
                }
            });
        }


        function AjaxSubmit() {
            $.ajax({
                url:'/sichuan_war_exploded/editPassword',
                type:"GET",
                data:{'p':1},
                dataType: "json",//返回的数据类型格式
                success:function (msg) {
                    console.log(msg)


                }
            })
        }



    </script>







</head>
<body>
<script type="text/javascript">
    AjaxSubmit()
</script>


<form action="">
    <ul class="editInfos">
        <li><label><font color="#ff0000">* </font>请输入旧密码：<input type="text" name="oldPassword" id="oldPassword" required value="" class="ipt" /></label></li>
        <li><label><font color="#ff0000">* </font>请输入新密码：<input type="text" name="newPassword" id="newPassword" required value="" class="ipt" /></label></li>
        <li><label><font color="#ff0000">* </font>请重复新密码：<input type="text" name="reNewPassword" id="reNewPassword" required value="" class="ipt" /></label></li>
        <li><input onclick="ajax_submit('${loginUser.username }');"  value="确认提交" class="submitBtn" /></li>
    </ul>
</form>


</body>
</html>